package com.tc.shiro.test;

import com.tc.cipher.ThreeDESUtil;
import com.tc.shiro.entity.PortalOperator;
import com.tc.shiro.utils.RandomCharUtils;
import com.tc.shiro.utils.SecurityUtils;

import java.util.Date;

public class InsertUser {

    public static  PortalOperator init(){
        PortalOperator portalOperator = new PortalOperator();
        portalOperator.setMercNo("001");
        portalOperator.setOperatorNo("100000068");
        portalOperator.setOperatorName("tc");
        portalOperator.setOperator("tc");
        portalOperator.setMercName("tc 公司");
        portalOperator.setRoleNo("999999999");
        portalOperator.setRoleName("管理员");
        portalOperator.setBindMobile(ThreeDESUtil.encryptDefault("1388888888"));
        portalOperator.setSalt(RandomCharUtils.getRandomALLChar(4));
        portalOperator.setLoginPassword(SecurityUtils.decryptAndDigest(SecurityUtils.encrypt("12345678"), portalOperator.getSalt()));
        portalOperator.setLastModifyPwdDate(new Date());
        portalOperator.setOperatorType(Byte.valueOf("1"));
        portalOperator.setOperatorStatus(Byte.valueOf("2"));
        portalOperator.setWrongPwdCount(Byte.valueOf("0"));
        portalOperator.setCreateDate(new Date());
        portalOperator.setUpdateDate(new Date());
        return portalOperator;
    }

}
